package device;

import javafx.event.EventHandler;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
import javafx.stage.WindowEvent;

public class DeviceMain  {
	private Stage primaryStage;

	public DeviceMain() {
		try {
			 primaryStage = new Stage();
			FXMLLoader loader = new FXMLLoader();
			loader.setLocation(getClass().getResource("/device/DeviceUI.fxml"));
			Parent root = (Parent)loader.load();
			Scene scene = new Scene(root);
			primaryStage.setScene(scene);
			primaryStage.setTitle("Device");
			primaryStage.setResizable(false);
			primaryStage.setOnCloseRequest(new EventHandler<WindowEvent>() {
	            @Override
	            public void handle(WindowEvent event) {
	    	        primaryStage.hide();
	            }
	          });
		} catch(Exception e) {
			e.printStackTrace();
		}
	}
	public void setprimaryStage() {
		this.primaryStage.show();
		
	}
}